package com.test.p06prototype.example01;

import java.util.Date;

public class Client01 {
    public static void main(String[] args) throws CloneNotSupportedException {
        Sheep sheep = new Sheep();
        sheep.setBirthday(new Date());
        sheep.setName("duoli");

        System.out.println(sheep);


        Sheep sheep2  = (Sheep)sheep.clone();

        System.out.println(sheep2);
        //使用的是浅拷贝，birthday是同一个对象
        System.out.println(sheep.getBirthday() == sheep2.getBirthday());
        System.out.println(sheep.getBirthday());
        System.out.println(sheep2.getBirthday());
        sheep.getBirthday().setTime(113493423434L);
        System.out.println(sheep.getBirthday());
        System.out.println(sheep2.getBirthday());
    }
}
